import sys

def generate(sequence, group_by=5, func=sum):
    print(iter(sequence))
    print([iter(sequence)])
    print(*[iter(sequence)])
    print(*[iter(sequence)]*group_by)
    print(zip(*[iter(sequence)]*group_by))
    for group in zip(*[iter(sequence)]*group_by):
        yield from group
        yield func(group)

a = [1,2,23,4,5,6,7,40,9,10,100,12,13,14,15,700,17,18,19,20]
        
print(*generate(a))

b = a
b[0] = 2
print(a)
print(b)
print("\n")
b = a.copy()
b[0] = 3
c = b
print(a)
print(b)

print("a: " + str(sys.getrefcount(a)))
print("b: " + str(sys.getrefcount(b)))
print("col: " + str(sys.getrefcount([3, 2, 23, 4, 5, 6, 7, 40, 9, 10, 100, 12, 13, 14, 15, 700, 17, 18, 19, 20])))
